package org.jeecg.modules.demo.hydrology.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.hydrology.dto.*;
import org.jeecg.modules.demo.hydrology.service.ILargeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags="大屏数据查询")
@RestController
@RequestMapping("/hydrology/large")
@Slf4j
public class LargeController {
    @Autowired
    private ILargeService largeService;

    //@AutoLog(value = "大屏数据查询")
    @ApiOperation(value="大屏数据查询", notes="大屏数据查询")
    @GetMapping(value = "/large")
    public Result<List<LargeDto>> getDhss() {
        List<LargeDto> largeDtos = largeService.getAlarms();
        return Result.ok(largeDtos);
    }
    @ApiOperation(value="大屏数据实时通知查询", notes="大屏数据实时通知查询")
    @GetMapping(value = "/immediateNotice")
    public Result< List<ImmediateNoticeDto>> getImmediateNotice(@RequestParam(name="code",required=true) String code,@RequestParam(name="codestationMine",required=true) String codestationMine) {
//        LargeDto  largeDto = largeService.getDhss();
//        return Result.OK(largeDto);
        List<ImmediateNoticeDto> immediateNoticeDtoList=largeService.getImmediateNotice(code,codestationMine);
        return Result.OK(immediateNoticeDtoList);
//        return null;

    }
    @ApiOperation(value="大屏数据监测信息统计查询", notes="大屏数据监测信息统计查询")
    @GetMapping(value = "/monitoringInformation")
    public Result< List<MonitoringInformation>> getmonitoringInformation(@RequestParam(name="code",required=true) String code) {

        List<MonitoringInformation> monitoringInformationList=largeService.getmonitoringInformation(code);
        return Result.OK(monitoringInformationList);

    }
    @ApiOperation(value="煤矿列表", notes="煤矿列表")
    @GetMapping(value = "/listMine")
    public Result<List<listMineDto>> getListMine() {
        List<listMineDto> mineDtoList = largeService.getListMine();
        return Result.ok(mineDtoList);
    }
    @ApiOperation(value="大屏数据统计", notes="大屏数据统计")
    @GetMapping(value = "/total")
    public Result<LargeDto> getTotal() {
        LargeDto largeDto  = largeService.getTotalAlarm();
        return Result.ok(largeDto);
    }

    @ApiOperation(value="大屏数据分类统计", notes="大屏数据分类统计")
    @GetMapping(value = "/category")
    public Result<List<CategoryDto>> getCategory() {
        List<CategoryDto> categoryDtos  = largeService.getCategory();
        return Result.ok(categoryDtos);
    }

    @ApiOperation(value="大屏数据对比", notes="大屏数据对比")
    @GetMapping(value = "/handle")
    public Result<List<Integer>> getHandle() {
        List<Integer> handle  = largeService.getHandle();
        return Result.ok(handle);
    }

    @ApiOperation(value="大屏异常统计", notes="大屏异常统计")
    @GetMapping(value = "/count")
    public Result<List<Integer>> getCount() {
        List<Integer> handle  = largeService.getCount();
        return Result.ok(handle);
    }

    @ApiOperation(value="大屏二矿异常统计", notes="大屏二矿异常统计")
    @GetMapping(value = "/categoryCount")
    public Result<List<Integer>> categoryCount(@RequestParam(name = "code",required = true) String code) {
        List<Integer> handle  = largeService.getCategoryCount(code);
        return Result.ok(handle);
    }

    @ApiOperation(value="大屏二矿监测数据", notes="大屏二矿监测数据")
    @GetMapping(value = "/monitor")
    public Result<List<MonitorDto>> getMonitor(@RequestParam(name = "code",required = true) String code) {
        List<MonitorDto> monitorDtos  = largeService.getMonitor(code);
        return Result.ok(monitorDtos);
    }

    @ApiOperation(value="排水量实时统计数据", notes="排水量实时统计数据")
    @GetMapping(value = "/pslTotal")
    public Result<List<PslTotalDto>> getPslTotal(@RequestParam(name = "date",required = true) String date) {
        List<PslTotalDto> pslTotal  = largeService.getPslTotal(date);
        return Result.ok(pslTotal);
    }

    @ApiOperation(value="折线数据", notes="折线数据")
    @GetMapping(value = "/getLine")
    public Result<List<HydrologyReportDto>> getLine(@RequestParam(name = "date",required = true) String date,@RequestParam(name = "code",required = true) String code) {
        List<HydrologyReportDto> hydrologyReportDtos  = largeService.getLineTotal(date,code);
        return Result.ok(hydrologyReportDtos);
    }
}


